package com.dgty.dg_common.widget

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.dgty.dg_common.R

/**
 * Title: EmptyView$
 * Description:
 *
 * Created DateTime: 2023/2/22$ 14:26$
 * Created by cacif$.
 */
class EmptyView(context: Context?) : LinearLayout(context) {
    lateinit var view: View
    lateinit var emptyImg: ImageView
    lateinit var emptyTv: TextView
    init {
        initView()
    }

    private fun initView() {
        view = LayoutInflater.from(context).inflate(R.layout.view_emptycontent, this, true)
        emptyImg = view.findViewById(R.id.img_empty)
        emptyTv = view.findViewById(R.id.tv_empty)
    }

    fun setEmptyImgRes(resId: Int) : EmptyView{
        emptyImg.setImageResource(resId)
        return this
    }

    fun setEmptyValue(value: String) : EmptyView {
        emptyTv.text = value
        return this
    }

}